home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 60.zip / BS1 part 60 / Cnet 2.60 d2.adf / programming / README! < prev    next >
Text File  |  1993-02-10  |  3KB  |  71 lines

  1.  
  2. The files in this subdirectory have been provided for C programmers to
  3. create their own C programs for use while ONLINE CNet AMIGA.  Some
  4. knowledge of the C language is required to make any use of these files.
  5.  
  6. CNet was compiled with the SAS/C Lattice C compiler.  Although the files
  7. on this disk are easily used with any other compiler, compiler-specific
  8. features have been used where necessary.
  9.  
  10. Here's a description of the files provided here:
  11.  
  12. CNET.H
  13. This is CNet's main "HEADER" file.  It contains definitions of all
  14. structures and variable types as used throughout CNet.
  15.  
  16. CNETFUNCS.H
  17. This file contains ANSI prototypes for all CNet's internal functions.  Only
  18. a handful of these may be used as call-backs to the main program while your
  19. program is running.
  20.  
  21. MINREXX.H
  22. This file contains the AREXX interface structures.  This will be of little
  23. use to most C programmers but is provided for completeness.
  24.  
  25. XPROTO.H
  26. This file contains the structure definitions and function prototypes for
  27. CNet's XPR protocol interface.  This will provided for completeness.
  28.  
  29. EMPTY.C
  30. A bare-bones program shell which provides the machinery for getting in and
  31. out of the external program.  It contains call back routines for ALL of the
  32. call-back functions that are currently supported.
  33.  
  34. INS.C
  35. This is the pre-compiler include file.  All include files are requested
  36. here.  This will be used to create a pre-compiled header file for fast
  37. compilation.
  38.  
  39. How to compile a program using SAS/C Lattice C:
  40.  
  41. First, create the pre-compiled header file "i" by using the command:
  42.  
  43.         lc -ph -oi ins
  44.  
  45. You need only do this once.  It must be repeated if any of the above ".H"
  46. files change.  Next, compile your program using:
  47.  
  48.         lc -Hi -rr -O -v -L -mact -ccft empty
  49.  
  50. where you replace "empty" with the actual name of your program.
  51.  
  52. Notes:
  53.  
  54. While your C pfile is running, you have access to ALL of CNet's variables.
  55. The variable 'z' provides a pointer to the current port's PortData
  56. structure (see CNET.H).  The variable 'myp' provides a pointer to the
  57. system's MainPort structure (again, see CNET.H).  As an example, to
  58. display the current user's name, the code:
  59.  
  60.         PutText( z->user1.Handle );
  61.  
  62. is effective.  To display what the user on port 1 is doing, the code:
  63.  
  64.         PutText( myp->PortDoing[1] );
  65.  
  66. will work--this assumes there IS someone on port 1!
  67.  
  68. Programming in CNet's C environment provides you with a lot of power.  If
  69. you have questions about specific variables, feel free to contact the
  70. support BBS as noted in the manual.
  71.